﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace Three.BookStore.Migrations
{
    /// <inheritdoc />
    public partial class InitDB003 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "SalesDeliveryOrder",
                columns: table => new
                {
                    Id = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    OrderNumber = table.Column<string>(type: "varchar(30)", nullable: false),
                    OrderCode = table.Column<string>(type: "varchar(30)", nullable: false),
                    Date = table.Column<TimeOnly>(type: "time without time zone", nullable: true),
                    DeliveryType = table.Column<string>(type: "varchar(30)", nullable: false),
                    Warehouse = table.Column<string>(type: "varchar(30)", nullable: false),
                    CustomerCode = table.Column<string>(type: "varchar(30)", nullable: false),
                    CustomerName = table.Column<string>(type: "varchar(30)", nullable: false),
                    Salesman = table.Column<string>(type: "varchar(30)", nullable: false),
                    ServiceOrder = table.Column<string>(type: "varchar(30)", nullable: false),
                    SettlementMethod = table.Column<string>(type: "varchar(30)", nullable: false),
                    Currency = table.Column<string>(type: "varchar(30)", nullable: false),
                    TotalAmount = table.Column<decimal>(type: "numeric(10,2)", nullable: true),
                    TotalWeight = table.Column<decimal>(type: "numeric(10,2)", nullable: true),
                    TotalPieces = table.Column<int>(type: "integer", nullable: true),
                    ReceivingAddress = table.Column<string>(type: "varchar(30)", nullable: false),
                    Remarks = table.Column<string>(type: "varchar(200)", nullable: false),
                    Status = table.Column<string>(type: "varchar(30)", nullable: false),
                    Creator = table.Column<string>(type: "varchar(30)", nullable: false),
                    RecordCreationTime = table.Column<TimeOnly>(type: "time without time zone", nullable: true),
                    RecordUpdateTime = table.Column<TimeOnly>(type: "time without time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SalesDeliveryOrder", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SalesDeliveryOrder");
        }
    }
}
